package arrays;

public class EvenArray {
	int a[]={1,0,2,-2,2,4,3,4,-5,6,7,5};

		public void arrangeEven ()
		{System .out.println("Array={1,0,2,-2,2,4,3,4,-5,6,7,5}");
		System .out.println("Rearranging with even nos at the beginning ");
		
		for(int i=0;i<a.length;i++)
		{
		         int temp=0;
		        
		         if (!( a[i]%2==0))
		             {
		                for(int j=i+1;j<a.length;j++)
		                    { 
		                       if (a[j] %2==0)
		                           {
		                    	   temp=a[i];
		                           a[i]=a[j];
		                           a[j]=temp;
		                           break;
		                           }//end ofinner if
		                      }// end of inner for

		              }// end of outer if
		  System.out.print(a[i]+" ");
	}// end of outer for

  }
		

}
